package com.xiaomi;

import com.xiaomi.RocketMQProducerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Main implements CommandLineRunner {

    @Autowired
    private RocketMQProducerService producerService;

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Main.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        producerService.sendMessage("TestTopic", "Hello RocketMQ");
    }
}